#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int qian = 0;
	float all = 0;
	int m = 0;
	int arr[1000] = { 0 };
	for(int i=1;i<=12;i++)
	{
		qian += 300;
		scanf("%d", &arr[i]);
		getchar();
		if (qian - arr[i]>=0)
		{
			qian -= arr[i];
			if (qian >= 100)
			{
				int k = 0;
				k += qian - (qian % 100);
				m += k;
				qian -= k;
			}
		}
		else if ((qian - arr[i])<0)
		{
			printf("%d", -i);
			return 0;
		}
	}
	all = (float)m * (1.2) + (float)qian;
	printf("%d", (int)all);
	return 0;
}